import java.math.BigDecimal;
import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.stream.Collectors;

public class Emp {
    private BigDecimal empno;

    private String ename;

    private String job;

    private BigDecimal mgr;

    private Date hiredate;

    private Double sal;

    private BigDecimal comm;

    private BigDecimal deptno;

    public BigDecimal getEmpno(Emp emp) {
        return empno;
    }

    public void setEmpno(BigDecimal empno) {
        this.empno = empno;
    }

    public String getEname() {
        return ename;
    }

    public void setEname(String ename) {
        this.ename = ename == null ? null : ename.trim();
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job == null ? null : job.trim();
    }

    public BigDecimal getMgr() {
        return mgr;
    }

    public void setMgr(BigDecimal mgr) {
        this.mgr = mgr;
    }

    public Date getHiredate() {
        return hiredate;
    }

    public void setHiredate(Date hiredate) {
        this.hiredate = hiredate;
    }

    public Double getSal() {
        return sal;
    }

    public void setSal(Double sal) {
        this.sal = sal;
    }

    public BigDecimal getComm(Emp aa) {
        return comm;
    }

    public void setComm(BigDecimal comm) {
        this.comm = comm;
    }

    public static Emp setThis(Emp comm) {
        System.out.println(comm);
        System.out.println("111111111111111111111111111111111");
        return comm;
    }
//    public  Emp setThis() {
//        System.out.println(comm);
//        System.out.println("111111111111111111111111111111111");
//        return null;
//    }

    public BigDecimal getDeptno() {
        return deptno;
    }

    public void setDeptno(BigDecimal deptno) {
        this.deptno = deptno;
    }

    public static void main(String[] args) {
        List<Emp> filterList = new ArrayList<>();
        Emp emp1 = new Emp();
        emp1.setEname("a");
        System.out.println(emp1);
        Emp emp2 = new Emp();
        emp2.setEname("b");
        System.out.println(emp2);
        Emp emp3 = new Emp();
        System.out.println(emp3);
        emp3.setEname("c");
        filterList.add(emp1);
        filterList.add(emp2);
        filterList.add(emp3);
        List<String> collect = filterList.stream().map(Emp::getEname).collect(Collectors.toList());
        System.out.println(collect);
        filterList.stream().map(null).collect(Collectors.toList());
        filterList.stream().map(emp ->{return emp.getEmpno(emp);}).collect(Collectors.toList());
        ///List<HashMap<String, Object>> inList = new ArrayList<HashMap<String, Object>>();
        Function<Emp, BigDecimal> setThisq = Emp::getDeptno;
        Function<Emp, Emp> setThiss = Emp::setThis;
        //BiFunction<Emp, Emp, Emp> setThisaa = Emp::setThis;
        BiFunction<Emp, Object, Boolean> equals= Emp::equals;
        BiFunction<Map, Object, Object> equalswww=Map::get;
        Function<Emp, Emp> setThissaa = new Function<Emp, Emp>(){
            @Override
            public Emp apply(Emp emp) {
                return Emp.setThis(emp);
            }
        };

        Function<Emp, BigDecimal> setThissaaww = new Function<Emp, BigDecimal>(){
            @Override
            public BigDecimal apply(Emp emp) {
                return emp.getDeptno();
            }
        };
        BiFunction<Emp, Object, Boolean> equalsaa=new BiFunction<Emp, Object, Boolean>(){
            @Override
            public Boolean apply(Emp emp, Object o) {
                return emp.equals(o);
            }
        };
        //List<Set<String>> collect = inList.stream().map(Map::get).collect(Collectors.toList());

//        Map<String, Object> map1 = new HashMap<String, Object>();
//        Map<String, Object> map2 = new HashMap<String, Object>();
//        Map<String, Object> map3 = new HashMap<String, Object>();
//        Map<String, Object> map4 = new HashMap<String, Object>();
//        List<Map<String, Object>> inList = new ArrayList<Map<String, Object>>();
//        map1.put("id", "111");
//        map1.put("name", "tom");
//        map1.put("sex", "male");
//        map2.put("id", "222");
//        map2.put("name", "jack");
//        map2.put("sex", "male");
//        map3.put("id", "333");
//        map3.put("name", "lucy");
//        map3.put("sex", "female");
//        map4.put("id", "444");
//        map4.put("name", "lucy");
//        map4.put("sex", "female");
//        inList.add(map1);
//        inList.add(map2);
//        inList.add(map3);
//        inList.add(map4);
//        List<Set<String>> collect = inList.stream().map(Map::containsKey).collect(Collectors.toList());
//        System.out.println(collect);
    }
}